<?php

namespace app\http\middleware;

class CheckBackend
{
    public function handle($request, \Closure $next)
    {

        if (!session('admin_id') && $request->controller()!='Login') {

            return redirect('backend/login/index');

        }

        return $next($request);
    }
}
